

import xadmin
from app01.models import *
from xadmin import views
from xadmin.plugins.auth import UserAdmin

class App01Admin(UserAdmin):
    pass

class BaseSetting(object):
    enable_themes = True
    # use_bootswatch = True

class GlobalSetting(object):
    site_title = 'saas后台管理系统'
    site_footer = '老男孩教育网'
    menu_style = 'accordion'

class PricePolicyAdmin(object):
    pass

class UserinfoAdmin(object):
    pass

class TransactionAdmin(object):
    pass

class ProjectAdmin(object):
    list_display = ['name', 'color', 'desc', 'user_space', 'star', 'join_count', 'creator', 'create_datetime']
    search_fields = ['name', 'desc']
    list_filter = ['name', 'color', 'desc', 'user_space', 'star', 'join_count', 'creator', 'create_datetime']

xadmin.site.register(PricePolicy, PricePolicyAdmin)
xadmin.site.register(Userinfo, UserinfoAdmin)
xadmin.site.register(Transaction, TransactionAdmin)
xadmin.site.register(Project, ProjectAdmin)

# xadmin.site.register(Userinfo, App01Admin)

xadmin.site.register(views.BaseAdminView, BaseSetting)
xadmin.site.register(views.CommAdminView, GlobalSetting)